<?php

namespace App\Http\Controllers\H5;

use GuzzleHttp\Client;
use Illuminate\Http\Request;

class QrCodeController extends BaseController
{
    public function index(Request $request){
        $uid = $request->input('uid');
        $qrcode = $this->officialAccount()->qrcode->temporary('inviter:'.$uid);
        $client = new Client();
        $response = $client->get($this->officialAccount()->qrcode->url($qrcode['ticket']));
        return $response->getBody();
    }
}
